package com.irdstudio.efp.riskm.api.rest;


import com.irdstudio.basic.framework.core.constant.ResponseData;
import com.irdstudio.basic.framework.web.controller.AbstractController;
import com.irdstudio.efp.riskm.service.facade.RscLoanChgHisService;
import com.irdstudio.efp.riskm.service.vo.RscLoanChgHisVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/api")
public class RscLoanChgHisController extends AbstractController {
	
	@Autowired
	@Qualifier("rscLoanChgHisService")
	private RscLoanChgHisService rscLoanChgHisService;

	
	/**
	 * 列表数据查询
	 * @param
	 * @param
	 * @return
	 */
	@RequestMapping(value="/rsc/loan/chg/hiss", method=RequestMethod.POST)
	public @ResponseBody ResponseData<List<RscLoanChgHisVO>> queryRscLoanChgHisAll(@RequestBody RscLoanChgHisVO vo) {
		List<RscLoanChgHisVO> outputVo = rscLoanChgHisService.queryAllOwner(vo);
		return getResponseData(outputVo);
	}
	
	/**
	 * 根据主键查询详情
	 * @return
	 */
	@RequestMapping(value="/rsc/loan/chg/his", method=RequestMethod.GET)
	public @ResponseBody ResponseData<RscLoanChgHisVO> queryByPk() {		
		RscLoanChgHisVO inVo = new RscLoanChgHisVO();
		RscLoanChgHisVO outputVo = rscLoanChgHisService.queryByPk(inVo);
		return getResponseData(outputVo);
		
	}
	/**
	 * luzhaoyu
	 * 2019/9/26
	 * 根据主键查询详情
	 * @return
	 */
	@RequestMapping(value="/rsc/loan/chg/his/billNo", method=RequestMethod.POST)
	public @ResponseBody ResponseData<List<RscLoanChgHisVO>> querybillNoByPk(@RequestBody RscLoanChgHisVO vo) {
		List<RscLoanChgHisVO> outputVo = rscLoanChgHisService.queryList(vo);
		return getResponseData(outputVo);
	}

	/**
	 * 根据主键删除信息
	 * @param inRscLoanChgHisVo
	 * @return
	 */
	@RequestMapping(value="/rsc/loan/chg/his", method=RequestMethod.DELETE)
	public @ResponseBody ResponseData<Integer> deleteByPk(@RequestBody RscLoanChgHisVO inRscLoanChgHisVo) {		
		int outputVo = rscLoanChgHisService.deleteByPk(inRscLoanChgHisVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 根据主键更新信息
	 * @param inRscLoanChgHisVo
	 * @return
	 */
	@RequestMapping(value="/rsc/loan/chg/his", method=RequestMethod.PUT)
	public @ResponseBody ResponseData<Integer> updateByPk(@RequestBody RscLoanChgHisVO inRscLoanChgHisVo) {		
		int outputVo = rscLoanChgHisService.updateByPk(inRscLoanChgHisVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 新增数据
	 * @param inRscLoanChgHisVo
	 * @return
	 */
	@RequestMapping(value="/rsc/loan/chg/his", method=RequestMethod.POST)
	public @ResponseBody ResponseData<Integer> insertRscLoanChgHis(@RequestBody RscLoanChgHisVO inRscLoanChgHisVo) {
		int outputVo = rscLoanChgHisService.insertRscLoanChgHis(inRscLoanChgHisVo);
		return getResponseData(outputVo);
		
	}
}
